<!DOCTYPE html>
<html lang="en">





<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" type="image/png" href="/img/favicon.png">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="My Personal Website For Blog">
  <meta name="author" content="黄宇辉">
  <meta name="keywords" content="learning note,hexo blog">
  <title>Understanding the GitHub flow - 欢迎参观小灰灰的网站哟 ヾ(◍°∇°◍)ﾉﾞ ~</title>

  <link  rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.staticfile.org/github-markdown-css/4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    <link  rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/10.0.0/styles/vs2015.min.css" />
  

  


<!-- 主题依赖的图标库，不要自行修改 -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_yg9cfy8wd6.css">

<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_pjno9b9zyxs.css">

<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script  src="/js/utils.js" ></script>
</head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/">&nbsp;<strong>ANONYMOUS</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                Home
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                Archives
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                Tags
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                About
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="view intro-2" id="background" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="container text-center white-text fadeInUp">
            <span class="h2" id="subtitle">
              
            </span>

            
              
  <div class="mt-3 post-meta">
    <i class="iconfont icon-date-fill" aria-hidden="true"></i>
    <time datetime="2019-07-16 07:45">
      July 16, 2019 am
    </time>
  </div>


<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      1.5k 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      15
       分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid">
  <div class="row">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-md">
      <div class="container nopadding-md" id="board-ctn">
        <div class="py-5" id="board">
          <div class="post-content mx-auto" id="post">
            
            <article class="markdown-body">
              <h2 id="学习笔记-GitHub工作流程"><a href="#学习笔记-GitHub工作流程" class="headerlink" title="学习笔记 : GitHub工作流程"></a>学习笔记 : GitHub工作流程</h2><p><em>GitHub流程(Git flow的简化版)是一种轻量级,基于分支的工作流程,支持定期进行部署的团队和项目. 本篇文章诠释了GitHub流程的工作原理及流程 .</em></p>
<p><em>GitHub工作流程可以简单地分为以下步骤 :</em></p>
<ol>
<li><em>第一步 : 根据需求,从<code>master</code>拉出新分支(不区分功能分支或补丁分支) .</em></li>
<li><em>第二步 : 新分支开发完成后需要合并,谈论时,就需要向<code>master</code>发起一个<code>pull request</code> (PR) .</em></li>
<li><em>第三步 : <code>Pull Request</code>既是一个通知 : 让别人注意到你的请求,又是一种对话机制 : 让大家一起审核及讨论你的更改信息, 对话过程中可以不断修改提交信息并提交哟 .</em></li>
<li><em>第四步 : 当<code>Pull Request</code>通过审核后,继而可以与<code>master</code>合并啦 ! 成功重新部署后,原来你创建的那个分支就可以删除咯(先部署再合并也可以哟) .</em></li>
</ol>
<p><em>A Successful Git Branching Model</em><br><img src="/2019/07/16/Understanding-the-GitHub-flow/A_successful_Git_branching_model.png" srcset="/img/loading.gif" alt=" "></p>
<h3 id="Create-a-branch"><a href="#Create-a-branch" class="headerlink" title="Create a branch"></a>Create a branch</h3><p><img src="/2019/07/16/Understanding-the-GitHub-flow/GitHubFlow-Create_a_branch.PNG" srcset="/img/loading.gif" alt=" "><br><em>当你在一个项目上工作时,你会在任何特定时间都有一堆不同的功能或想法,既而分支可以帮助你管理其工作流程. 在项目中创建分支等同于创建一个可以尝试新想法的环境. 你在新建分支上所做的更改并不会影响<code>master</code>分支(主分支),因此你可以自由地进行实验和提交更改信息,并且在你准备好与你正在协作的人进行审核此分支前,其并不会与<code>master</code>分支合并,既而也不会污染到主分支哟 ~</em></p>
<p><em>Tip : 分支是<code>Git</code>中的核心概念,整个GitHub流程都是基于它的. 注意点 : <code>master</code>分支中的任何内容始终都是可部署的. 因此,在处理或修复功能时,创建新分支是必要的操作,注意哟,分行名称应该是具有描述性的(如 : refactor-authentication,user-content-cache-key,make-retina-avatars),以便其他人理解正在进行的工作内容 .</em></p>
<h3 id="Add-commits"><a href="#Add-commits" class="headerlink" title="Add commits"></a>Add commits</h3><p><img src="/2019/07/16/Understanding-the-GitHub-flow/GitHubFlow-Add_commits.PNG" srcset="/img/loading.gif" alt=" "><br><em>创建分支后,就可以对其进行更改咯. 无论何时添加,编辑或删除文件,你最终都需要进行提交并将它们添加到你的分支,添加提交的过程会为你创建一份透明的工作历史记录,以便其他人可以了解你已完成的工作. 每个提交都有一个关联的提交信息描述,该信息是解释为何进行特定更改的描述. 此外,每个提交都被视为一个单独的变更单位,既而如果发现程序错误或想决定改变开发方向,你都可以回滚其更改的信息哟 .</em></p>
<p><em>Tip : 提交时的描述消息很重要,因为Git会跟踪你的更改,然后在将它们推送到服务器后将其显示提交的描述信息. 通过编写清晰的提交描述信息,可以更轻松地让其他人跟进并提供反馈信息 .</em></p>
<h3 id="Open-a-Pull-Request"><a href="#Open-a-Pull-Request" class="headerlink" title="Open a Pull Request"></a>Open a Pull Request</h3><p><img src="/2019/07/16/Understanding-the-GitHub-flow/GitHubFlow-Open_a_Pull_Request.PNG" srcset="/img/loading.gif" alt=" "><br><em><code>Pull Requests</code>会启动有关你的提交的讨论. 任何人都可以确切地看到他们所接受的你的请求及将会合并哪些更改等信息. 你可以在开发过程中的任何时候使用拉取请求 : 如当你想要分享一些屏幕截图或一些想法,或遇到困难并需要帮助或建议时… 当你准备好想让某人审查你的工作时,可以通过在Pull Request消息中使用GitHub的<code>@mention</code>哟 ~</em></p>
<p><em>Tip : <code>Pull Requests</code>对于贡献开源项目和管理对共享存储库的更改非常有帮助. 如果你使用的是<code>Fork＆Pull</code>模式 : 则<code>Pull Requests</code>提供了一种可以通知项目维护者你希望他们考虑的更改的方法. 如果你使用的是共享存储库模式 : 则<code>Pull Requests</code>会在合并到主分支之前帮助启动代码审查和有关建议更改的对话 .</em></p>
<h3 id="Discuss-and-review-your-code"><a href="#Discuss-and-review-your-code" class="headerlink" title="Discuss and review your code"></a>Discuss and review your code</h3><p><img src="/2019/07/16/Understanding-the-GitHub-flow/GitHubFlow-Discuss_and_review_your_code.PNG" srcset="/img/loading.gif" alt=" "><br><em>一旦<code>Pull Request</code>开始,审核你的更改信息的人员或团队可能会有问题或意见,其原因可能是因为编码风格与项目编码风格规定不符等等等 .. <code>Pull Requests</code>后的这个审核与探讨的过程是非常有意义的,如果有人评论你忘了做某事或代码中有错误,你可以在分支中修复它并继续推送其更改信息. GitHub将在统一的Pull Request视图中显示你的新提交及你可能收到的任何其他反馈信息 .</em></p>
<p><em>Tip : <code>Pull Request</code>的评论是用<code>Markdown</code>编写的,因此你可以嵌入图片和表情符号,或使用预先格式化的文本块哟 ~</em></p>
<h3 id="Deploy"><a href="#Deploy" class="headerlink" title="Deploy"></a>Deploy</h3><p><img src="/2019/07/16/Understanding-the-GitHub-flow/GitHubFlow-Deploy.PNG" srcset="/img/loading.gif" alt=" "><br><em>(实际开发中所需步骤) 一旦你的<code>pull request</code>请求被检查并且分支通过测试,你就可以通过重新部署继而在生产中验证它们. 若你发现你的分支出现了错误,则可以通过将现有的主服务器部署到生产环境中来回滚它 .</em></p>
<h3 id="Merge"><a href="#Merge" class="headerlink" title="Merge"></a>Merge</h3><p><img src="/2019/07/16/Understanding-the-GitHub-flow/GitHubFlow-Merge.PNG" srcset="/img/loading.gif" alt=" "><br><em>现在你的更改已在生产中得到验证,是时候将代码合并到主分支中了啦. 合并后,<code>Pull Requests</code>会保留代码更改的记录,且它们是可被搜索到的,所以任何人都可以随时回头来查看,理解当初做出决定的解释信息 .</em></p>
<p><em>Tip : 通过将某些关键字合并到<code>Pull Request</code>的文本中,可以将<code>issues</code>与代码相关联. 合并<code>Pull Request</code>请求后,相关问题也将关闭. 例如 : 输入关键字<code>Closes #32</code>后将关闭存储库中的第32个<code>issue</code>. 更多信息请查看帮助文章 : <a href="https://help.github.com/en/articles/closing-issues-using-keywords" target="_blank" rel="noopener">https://help.github.com/en/articles/closing-issues-using-keywords</a></em></p>
<p><em>🙂 refer to : <a href="https://guides.github.com/introduction/flow/" target="_blank" rel="noopener">https://guides.github.com/introduction/flow/</a></em></p>

            </article>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/github/">github_</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" target="_blank" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！</p>
              
              
                <div class="post-prevnext row">
                  <div class="post-prev col-6">
                    
                    
                      <a href="/2019/07/17/%E5%B0%8F%E7%88%AC%E8%99%AB-JDBookCrawler-V3-0/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">小爬虫:JDBookCrawler-V3.0</span>
                        <span class="visible-mobile">Previous</span>
                      </a>
                    
                  </div>
                  <div class="post-next col-6">
                    
                    
                      <a href="/2019/07/15/%E5%B0%8F%E7%88%AC%E8%99%AB-JDBookCrawler-V2-0/">
                        <span class="hidden-mobile">小爬虫:JDBookCrawler-V2.0</span>
                        <span class="visible-mobile">Next</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </div>
                </div>
              
            </div>

            
          </div>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;TOC</p>
  <div id="tocbot"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    
  </main>

  
    <a id="scroll-top-button" href="#" role="button">
      <i class="iconfont icon-arrowup" aria-hidden="true"></i>
    </a>
  

  
    <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">Search</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">keyword</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
  

  

  

  <footer class="mt-5">
  <div class="text-center py-3">
    <div>
      <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a>
      <i class="iconfont icon-love"></i>
      <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener">
        <span>Fluid</span></a>
    </div>
    
  <div class="statistics">
    
    

    
      
        <!-- 不蒜子统计PV -->
        <span id="busuanzi_container_site_pv" style="display: none">
            总访问量 
            <span id="busuanzi_value_site_pv"></span>
             次
          </span>
      
      
        <!-- 不蒜子统计UV -->
        <span id="busuanzi_container_site_uv" style="display: none">
            总访客数 
            <span id="busuanzi_value_site_uv"></span>
             人
          </span>
      
    
  </div>


    

    
  </div>
</footer>

<!-- SCRIPTS -->
<script  src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js" ></script>
<script  src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js" ></script>
<script  src="/js/debouncer.js" ></script>
<script  src="/js/main.js" ></script>

<!-- Plugins -->


  
    <script  src="/js/lazyload.js" ></script>
  



  <script defer src="https://cdn.staticfile.org/clipboard.js/2.0.6/clipboard.min.js" ></script>
  <script  src="/js/clipboard-use.js" ></script>



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>





  <script  src="https://cdn.staticfile.org/tocbot/4.11.1/tocbot.min.js" ></script>
  <script>
    $(document).ready(function () {
      var boardCtn = $('#board-ctn');
      var boardTop = boardCtn.offset().top;

      tocbot.init({
        tocSelector: '#tocbot',
        contentSelector: 'article.markdown-body',
        headingSelector: 'h1,h2,h3,h4,h5,h6',
        linkClass: 'tocbot-link',
        activeLinkClass: 'tocbot-active-link',
        listClass: 'tocbot-list',
        isCollapsedClass: 'tocbot-is-collapsed',
        collapsibleClass: 'tocbot-is-collapsible',
        collapseDepth: 0,
        scrollSmooth: true,
        headingsOffset: -boardTop
      });
      if ($('.toc-list-item').length > 0) {
        $('#toc').css('visibility', 'visible');
      }
    });
  </script>



  <script  src="https://cdn.staticfile.org/typed.js/2.0.11/typed.min.js" ></script>
  <script>
    var typed = new Typed('#subtitle', {
      strings: [
        '  ',
        "Understanding the GitHub flow&nbsp;",
      ],
      cursorChar: "_",
      typeSpeed: 70,
      loop: false,
    });
    typed.stop();
    $(document).ready(function () {
      $(".typed-cursor").addClass("h2");
      typed.start();
    });
  </script>



  <script  src="https://cdn.staticfile.org/anchor-js/4.2.2/anchor.min.js" ></script>
  <script>
    anchors.options = {
      placement: "right",
      visible: "hover",
      
    };
    var el = "h1,h2,h3,h4,h5,h6".split(",");
    var res = [];
    for (item of el) {
      res.push(".markdown-body > " + item)
    }
    anchors.add(res.join(", "))
  </script>



  <script  src="/js/local-search.js" ></script>
  <script>
    var path = "/local-search.xml";
    var inputArea = document.querySelector("#local-search-input");
    inputArea.onclick = function () {
      searchFunc(path, 'local-search-input', 'local-search-result');
      this.onclick = null
    }
  </script>



  <script  src="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.css" />

  <script>
    $('#post img:not(.no-zoom img, img[no-zoom]), img[zoom]').each(
      function () {
        var element = document.createElement('a');
        $(element).attr('data-fancybox', 'images');
        $(element).attr('href', $(this).attr('src'));
        $(this).wrap(element);
      }
    );
  </script>







  
  
    <script>
      !function (e, t, a) {
        function r() {
          for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
          requestAnimationFrame(r)
        }

        function n() {
          var t = "function" == typeof e.onclick && e.onclick;
          e.onclick = function (e) {
            t && t(), o(e)
          }
        }

        function o(e) {
          var a = t.createElement("div");
          a.className = "heart", s.push({
            el: a,
            x: e.clientX - 5,
            y: e.clientY - 5,
            scale: 1,
            alpha: 1,
            color: c()
          }), t.body.appendChild(a)
        }

        function i(e) {
          var a = t.createElement("style");
          a.type = "text/css";
          try {
            a.appendChild(t.createTextNode(e))
          } catch (t) {
            a.styleSheet.cssText = e
          }
          t.getElementsByTagName("head")[0].appendChild(a)
        }

        function c() {
          return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
        }

        var s = [];
        e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) {
          setTimeout(e, 1e3 / 60)
        }, i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), n(), r()
      }(window, document);
    </script>
  














</body>
</html>
